package com.example.a7822.myapplication.shopcart.beans;

import java.io.Serializable;

/**
 * Created by li on 2017/1/11.
 */

public class GoodBean implements Serializable {

    private int goodId;//商品表id
    private String goodShelveId;//商品上架id
    private String goodCode;//商品编号
    private String goodName;//商品名
    private String goodDesc;//商品描述

    private String goodPic;//商品上架图片
    private double goodPriceNow;//商品现价
    private double goodPriceBefore;//商品原价
    private int goodAmount = 1;//商品数量
    private double goodTotalPrice;



    private boolean isSelected = false;

    public void setGoodId(int goodId) {
        this.goodId = goodId;
    }
    public GoodBean(){}

    public GoodBean(int goodId, String goodName, String goodPic, double goodPrice, int goodAmount) {
        this.goodId = goodId;
        this.goodName = goodName;
        this.goodPic = goodPic;
        this.goodPriceNow = goodPrice;
        this.goodPriceBefore = goodPrice;
        this.goodAmount = goodAmount;

        this.goodTotalPrice = this.goodPriceNow*this.goodAmount;

    }
    /****getter and setter***/
    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public void setGoodPic(String goodPic) {
        this.goodPic = goodPic;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public void setGoodAmount(int goodAmount) {
        this.goodAmount = goodAmount;
    }

    public void setGoodTotalPrice() {
        this.goodTotalPrice = this.goodPriceNow*this.goodAmount;
    }

    public int getGoodId() {
        return goodId;
    }

    public String getGoodName() {
        return goodName;
    }

    public String getGoodPic() {
        return goodPic;
    }


    public int getGoodAmount() {
        return goodAmount;
    }

    public double getGoodTotalPrice() {
        return goodTotalPrice;
    }

    public String getGoodCode() {
        return goodCode;
    }

    public void setGoodCode(String goodCode) {
        this.goodCode = goodCode;
    }

    public double getGoodPriceNow() {
        return goodPriceNow;
    }

    public void setGoodPriceNow(double goodPriceNow) {
        this.goodPriceNow = goodPriceNow;
    }

    public double getGoodPriceBefore() {
        return goodPriceBefore;
    }
    public void setGoodPriceBefore(double goodPriceBefore) {
        this.goodPriceBefore = goodPriceBefore;
    }

    public String getGoodShelveId() {
        return goodShelveId;
    }

    public void setGoodShelveId(String goodShelveId) {
        this.goodShelveId = goodShelveId;
    }

    public String getGoodDesc() {
        return goodDesc;
    }

    public void setGoodDesc(String goodDesc) {
        this.goodDesc = goodDesc;
    }
}
